/*
package com.service.impl;

import com.entity.HyPayment;
import org.springframework.stereotype.Service;

*/
/**
 * @program: springboot89nep
 * @description:
 * @author: Baiyyy
 * @create: 2025-02-18 13:13
 **//*

@Service( "alipayService")
public class AlipayService {

    private String initiatePaymentRequestToPayPlatform(HyPayment hyPayment) {
        // 配置支付宝支付的参数
        String appId = "9021000141612988";
        String privateKey = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCGebsoyoSq3dBVJsmial9uSGs8xjBU92OM9pOxQfJCgq2uyoPm7erb+CErNv/yvaE3oYrjy9bu+L+o94dUcmOEte5ngtWuIUEiIQlJ8ZkLINN2mcMeB/zbL5z0gcDYliwGWacyP2PPlxlal+gzVeso1/ppx/Y+uY7puIZF3IKSn2CqsBqLNeEXLQ/Bt5WcHh+0GQjWlLWs0t+0QLIDUAZeUw5K1PNZVB7b4iAcWRWN8eFBMbVXqIBTcl8IoCioQQQJ13WSl/kCmcdsR15O0RYUQR9+9bHH9c0Gh3ranzBygtnYVv+U0fKHI7DiS8/eLR/owT6HA5Dw6obSdFFoe47hAgMBAAECggEAAe/e8kd4gb2QMqnMXbqKhVwlr0prh83IcU9b8UGx66NWPR5NqBXlPCXm1GiGZ0iz+ckp5v4YqniKyjRGjsDXDiJQvMz1pvxzo7o2GAqS2cYvRZYRaW1UBxQ4fo0f6f6/w5enAOJI3cSfaN6nSZYDPSNfSAbJVT33AQbXaEo010fPE3GaRWEpmNekRTFVfMv2Tfee8UiQDxXAg33zfk2Lgl5zwHmWoeOpib1ClBGGKBvSYXhHK/z/A6CMQsT2pE5R4epRGYT4UptMZsVkFMdejGuezpnJxT0OV3AYOMt6ub6U3WShbFu4zZzjl2UI7Gdhcw8Or7mel9UiUTlDac4EAQKBgQDAJBHrftbsCB8j/bME5HFZWNF6r63fLUGovz9V6LWEBpZQ1SJcXoWZaPVEk8xYFUlx5ZyYINiwtthH+wLUFO69WhyhHl0JX732AQps0B8Th9kHr7IJXeQJOPWKO3US9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9lpxYHQC3WZ7OgCCAJc2rt3SV+Lsm24ULzGGvszgiHFTxt+qrXl+7YA3KBA4kVJvAQIDAQAB";
        String serverUrl = "https://openapi.alipay.com/gateway.do";  // 支付宝API网关地址


        // 创建AlipayClient实例
        AlipayClient alipayClient = new DefaultAlipayClient(
                serverUrl, appId, privateKey, "json", "UTF-8", publicKey, "RSA2");



        // 创建请求对象
        AlipayTradePagePayRequest request = new AlipayTradePagePayRequest();
        request.setReturnUrl("你的支付成功回调URL");  // 支付成功后跳转的URL
        request.setNotifyUrl("你的支付通知URL");  // 支付回调的通知URL



        // 设置支付参数
        request.setBizContent("{"
                + "\"out_trade_no\":\"" + hyPayment.getOrderId() + "\","
                + "\"total_amount\":" + hyPayment.getAmount() + ","
                + "\"subject\":\"订单支付\","
                + "\"product_code\":\"FAST_INSTANT_TRADE_PAY\""
                + "}");


        try {
            // 发送请求并获取支付宝支付页面链接
            AlipayTradePagePayResponse response = alipayClient.pageExecute(request);
            if (response.isSuccess()) {
                return response.getBody(); // 支付页面链接
            } else {
                return "支付请求失败";
            }
        } catch (AlipayApiException e) {
            e.printStackTrace();
            return "支付请求失败";
        }


    }
}
*/
